/**
 * <copyright>
 *
 * Copyright (c) 2011 Zeligsoft (2009) Limited
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   Zeligsoft (2009) Limited - Initial API and implementation
 *
 * </copyright>
 *
 */
package org.omg.deployment.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.omg.deployment.DeploymentPackage;
import org.omg.deployment.ImplementationDependency;
import org.omg.xmi.impl.XMIImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Implementation Dependency</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.omg.deployment.impl.ImplementationDependencyImpl#getRequiredType <em>Required Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ImplementationDependencyImpl extends XMIImpl implements
		ImplementationDependency {
	/**
	 * The default value of the '{@link #getRequiredType() <em>Required Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRequiredType()
	 * @generated
	 * @ordered
	 */
	protected static final String REQUIRED_TYPE_EDEFAULT = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ImplementationDependencyImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DeploymentPackage.eINSTANCE.getImplementationDependency();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getRequiredType() {
		return (String) getGroup()
				.get(DeploymentPackage.eINSTANCE
						.getImplementationDependency_RequiredType(),
						true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRequiredType(String newRequiredType) {
		((FeatureMap.Internal) getGroup()).set(DeploymentPackage.eINSTANCE
				.getImplementationDependency_RequiredType(), newRequiredType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DeploymentPackage.IMPLEMENTATION_DEPENDENCY__REQUIRED_TYPE:
			return getRequiredType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case DeploymentPackage.IMPLEMENTATION_DEPENDENCY__REQUIRED_TYPE:
			setRequiredType((String) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case DeploymentPackage.IMPLEMENTATION_DEPENDENCY__REQUIRED_TYPE:
			setRequiredType(REQUIRED_TYPE_EDEFAULT);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DeploymentPackage.IMPLEMENTATION_DEPENDENCY__REQUIRED_TYPE:
			return REQUIRED_TYPE_EDEFAULT == null ? getRequiredType() != null
					: !REQUIRED_TYPE_EDEFAULT.equals(getRequiredType());
		}
		return super.eIsSet(featureID);
	}

} //ImplementationDependencyImpl
